import java.io.IOException;


public class PeopleParser extends Parser
{

    public PeopleParser(String file) throws IOException
    {
        super(file);
    }

    @Override
    public void parse() throws IOException
    {
        String line;
        while ((line = reader.readLine()) != null)
        {
            String[] fields = line.split(",");
            
            String first = fields[1].replace("'", "''");
            String last = fields[0].replace("'", "''");
            String id = fields[2];
            
            writer.write("INSERT INTO Players (name, playerid) VALUES ('" + first + ' ' + last + "', '" + id + "');\n");
        }
        reader.close();
        writer.close();
    }
}
